<?php
include("includes/database/dbconnect_mysql_procedural.inc");
//I made a change
?>


<?php
	
	if (isset($_POST['submit'])) {  

		$username = $_POST['username'];
		$password = $_POST['password'];
		
/* START TEST =============================================================================================================================================*/		
		$mtime2 = microtime();
		$mtime2 = explode(" ",$mtime2);
		$mtime2 = $mtime2[1] + $mtime2[0];
		$starttime2 = $mtime2;		
   
		$sql2 = "SELECT count(user_id) AS user_id_count FROM members WHERE username = '$username' AND password = '$password' LIMIT 1";
		$result2 = mysql_query($sql2) or die(mysql_error());
		$row = mysql_fetch_assoc($result2);
		
		if ($row['user_id_count'] > 0 ){
		
			echo 'found one -  <br />';		
		}
		
		if ($row['user_id_count'] < 1 ){
			
			echo 'username or password does not exist <br />';
		}
		
		$mtime2 = microtime();
		$mtime2 = explode(" ",$mtime2);
		$mtime2 = $mtime2[1] + $mtime2[0];
		$endtime2 = $mtime2;
		$totaltime2 = ($endtime2 - $starttime2);
		echo $totaltime2 . " mysql_fetch_assoc <br />";	
/* END TEST =============================================================================================================================================*/		
		
		
/* START TEST =============================================================================================================================================*/		
	   $mtime1 = microtime();
	   $mtime1 = explode(" ",$mtime1);
	   $mtime1 = $mtime1[1] + $mtime1[0];
	   $starttime1 = $mtime1;		
	
		$sql1 = "SELECT count(id) FROM members WHERE username = '$username' AND password = '$password' LIMIT 1";
		$result1 = mysql_query($sql1) or die(mysql_error());
		
		if (mysql_result($result1, 0) > 0){ 
			echo 'found one - <br />';
		}
		
		if (mysql_result($result1, 0) < 1){
			echo 'username or password does not exist';
		}
		
		$mtime1 = microtime();
		$mtime1 = explode(" ",$mtime1);
		$mtime1 = $mtime1[1] + $mtime1[0];
		$endtime1 = $mtime1;
		$totaltime1 = ($endtime1 - $starttime1);
		
		echo $totaltime1 . "my_sql_result <br />";
/* END TEST =============================================================================================================================================*/	
	
	
/* START TEST =============================================================================================================================================*/	
		$mtime3 = microtime();
		$mtime3 = explode(" ",$mtime3);
		$mtime3 = $mtime3[1] + $mtime3[0];
		$starttime3 = $mtime3;		
  
		$sql3 = "SELECT count(*) FROM members WHERE username = '$username' AND password = '$password' LIMIT 1";
		$result3 = mysql_query($sql3) or die(mysql_error());
		
		if (mysql_result($result3, 0) > 0){ 
			echo 'found one <br />';
		}
		
		if (mysql_result($result1, 0) < 1){
			echo 'username or password does not exist';
		}
		
		$mtime3 = microtime();
		$mtime3 = explode(" ",$mtime3);
		$mtime3 = $mtime3[1] + $mtime3[0];
		$endtime3 = $mtime3;
		$totaltime3 = ($endtime3 - $starttime3);
		
		echo $totaltime3 . " my_sql_result count * <br />";
	
/* END TEST =============================================================================================================================================*/	
	
} // end if 
	
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
body {
	background-color: #465D7C;
}
#content {
	width: 617px;
	border: 3px none #111111;
	margin-right: auto;
	margin-left: auto;
	height: auto;
	background-color: #465D7C;
}
#container #content #loginContainer {
	height: auto;
	width: 350px;
	margin-right: auto;
	margin-left: auto;
	margin-top: 120px;
	background-color: #FFF;
	border: 4px solid #081000;
}
.classLeft {
}
</style>
<style type="text/css">

<style type="text/css">
p{
	margin-top: 0px;
	padding-bottom: 10px;
	line-height: 21px;
	padding-right: 85px;
	padding-left: 85px;
}
.inputSize {
	width: 150px;
}
.tdDataInput {
	text-align: left;
	font-family: Tahoma, Geneva, sans-serif;
}
    .tableDataLabel {
	font-family: Tahoma, Geneva, sans-serif;
	font-size: 10pt;
	text-align: right;
	width: 80px;
	margin-right: auto;
	margin-left: auto;
	padding-right: 5px;
	padding-top: 8px;
	padding-bottom: 8px;
}


.forgotPassword {
	font-family: Tahoma, Geneva, sans-serif;
	font-size: 10pt;
	margin-right: 108px;
}
#container #content #loginContainer #forgot {
	text-align: left;
	font-family: Tahoma, Geneva, sans-serif;
	font-size: 10pt;
	width: 200px;
	margin-left: 22px;
	margin-top: 10px;
}
#adminContainer #contentBox #editableRegion #allTextGoesHere #frame #tablePersonal tr .tdDataInput #submit {
}
.classCenter {
	float: none;
	margin-left: 40px;
}
#container #content #loginContainer #tablePersonal {
	margin-top: 40px;
	margin-bottom: 20px;
	margin-left: 30px;
}


.forgot2 {
	font-family: Tahoma, Geneva, sans-serif;
	font-size: 10pt;
	text-align: left;
	width: 150px;
}

</style>

</head>

<body>

<div id="container">
  <div id="content">


    <div id="loginContainer">
      <table id="tablePersonal">
      <form action="benchmark_count.php" method="post" name="thenaame" target="_self">
    <tr>
      <td class="tableDataLabel">Username</td>
      <td class="tdDataInput"><input name="username" type="text" class="class_textbox" value="" maxlength="33" /></td>
    </tr>
    <tr>
      <td class="tableDataLabel">Password</td>
      <td class="tdDataInput"><input name="password" type="password" class="class_textbox" value="" maxlength="33" /></td>
    </tr>
    <tr>
      <td class="tableDataLabel">&nbsp;</td>
      <td class="tdDataInput"><input name="submit" type="submit" id="submit" value="submit"/></td>
    </tr>
    <tr>
      <td colspan="2" class="tableDataLabel"><div id="forgot"><a href="#">Forgot Password?</a></div></td>
      </tr>
  
 
    
    </form>
      </table>
    </div>
    
    
    

  </div>
</div> 
<!--end container -->
</body>
</html>

